<?php require_once('../Connections/analisis2.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "../login.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "../login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
  $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_analisis2, $analisis2);
$query_Categorias = "SELECT * FROM categoria";
$Categorias = mysql_query($query_Categorias, $analisis2) or die(mysql_error());
$row_Categorias = mysql_fetch_assoc($Categorias);
$totalRows_Categorias = mysql_num_rows($Categorias);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Analisis y Dise&ntilde;o de Sistemas 2</title>
<!-- TemplateEndEditable -->
<link rel="stylesheet" type="text/css" href="../style.css" />
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<body>
<div id="wrap">

       <div class="header">
       		<div class="logo"><br></div>            
        <div id="menu">
            <ul>                                                                       
            <li class="selected"><a href="../index.html">Inicio</a></li>
            <li></li>
            <li></li>
            <li></li>
            <li><a href="../myaccount.html">Publicaciones que sigo</a></li>
            <li><a href="../register.html">Busqueda</a></li>
            <li></li>
            <li><a href="../contact.html">Perfil</a><a href="<?php echo $logoutAction ?>">Cerrar Sesion</a></li>
            </ul>
        </div>     
            
            
       </div> 
       
       
       <div class="center_content"><!-- TemplateBeginEditable name="Centro" -->
         <div class="left_content">
           <div class="title"><span class="title_icon"><img src="../images/bullet1.gif" alt="" title="" /></span>Featured books</div>
           <div class="feat_prod_box">
             <div class="prod_img"><a href="../details.html"><img src="../images/prod1.gif" alt="" title="" border="0" /></a></div>
             <div class="prod_det_box">
               <div class="box_top"></div>
               <div class="box_center">
                 <div class="prod_title">Product name</div>
                 <p class="details">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.</p>
                 <a href="../details.html" class="more">- more details -</a>
                 <div class="clear"></div>
               </div>
               <div class="box_bottom"></div>
             </div>
             <div class="clear"></div>
           </div>
           <div class="feat_prod_box">
             <div class="prod_img"><a href="../details.html"><img src="../images/prod2.gif" alt="" title="" border="0" /></a></div>
             <div class="prod_det_box">
               <div class="box_top"></div>
               <div class="box_center">
                 <div class="prod_title">Product name</div>
                 <p class="details">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.</p>
                 <a href="../details.html" class="more">- more details -</a>
                 <div class="clear"></div>
               </div>
               <div class="box_bottom"></div>
             </div>
             <div class="clear"></div>
           </div>
           <div class="title"><span class="title_icon"><img src="../images/bullet2.gif" alt="" title="" /></span>New books</div>
           <div class="new_products">
             <div class="new_prod_box"> <a href="../details.html">product name</a>
               <div class="new_prod_bg"> <span class="new_icon"><img src="../images/new_icon.gif" alt="" title="" /></span> <a href="../details.html"><img src="../images/thumb1.gif" alt="" title="" class="thumb" border="0" /></a> </div>
             </div>
             <div class="new_prod_box"> <a href="../details.html">product name</a>
               <div class="new_prod_bg"> <span class="new_icon"><img src="../images/new_icon.gif" alt="" title="" /></span> <a href="../details.html"><img src="../images/thumb2.gif" alt="" title="" class="thumb" border="0" /></a> </div>
             </div>
             <div class="new_prod_box"> <a href="../details.html">product name</a>
               <div class="new_prod_bg"> <span class="new_icon"><img src="../images/new_icon.gif" alt="" title="" /></span> <a href="../details.html"><img src="../images/thumb3.gif" alt="" title="" class="thumb" border="0" /></a> </div>
             </div>
           </div>
           <div class="clear"></div>
         </div>
       <!-- TemplateEndEditable --><!--end of left content-->
        
      <div class="right_content">
        	<div class="right_box">
        	  <div class="title"><span class="title_icon"><img src="../images/bullet5.gif" alt="" title="" /></span>Categorias</div>
        	  <ul class="list">
        	    <li>
        	      <table width="200" border="0">
        	        <?php do { ?>
       	            <tr>
       	              <td><a href="#"><?php echo $row_Categorias['nombre']; ?></a></td>
      	            </tr>
        	          <?php } while ($row_Categorias = mysql_fetch_assoc($Categorias)); ?>
                  </table>
        	    </li>
       	      </ul>
        	  <p>&nbsp;</p>
        	  <ul class="list">
        	    <li></li>
      	    </ul>
        	  <div class="title"><span class="title_icon"><img src="../images/bullet6.gif" alt="" title="" /></span>Mejores Publicadores</div>
        	  <ul class="list">
        	    <li><a href="#">accesories</a></li>
        	    <li><a href="#">books gifts</a></li>
        	    <li><a href="#">specials</a></li>
        	    <li><a href="#">hollidays gifts</a></li>
        	    <li><a href="#">accesories</a></li>
        	    <li><a href="#">books gifts</a></li>
        	    <li><a href="#">specials</a></li>
        	    <li><a href="#">hollidays gifts</a></li>
        	    <li><a href="#">accesories</a></li>
      	    </ul>
      	  </div>
        </div><!--end of right content-->
        
        
       
       
       <div class="clear"></div>
       </div><!--end of center content-->
       
              
       <div class="footer">
       	<div class="left_footer"><img src="../images/footer_logo.gif" alt="" title="" /></div></div></div>

</body>
</html>
<?php
mysql_free_result($Categorias);
?>
